import pdfplumber  # pip install pdfplumber
import pandas as pd

pdf_path = 'D:\\hbyt\\AI智能投标\\能力组件-附件\\激励及绩效管理_v1.0_2201.pdf'

with pdfplumber.open(pdf_path) as pdf:
    for i, page in enumerate(pdf.pages):
        tables = page.extract_tables()
        for j, table in enumerate(tables):
            df = pd.DataFrame(table)
            df.to_csv(f'table_page{i+1}_{j+1}.csv', index=False)

print("表格提取完成！")


